package com.sise.dubbo.config.protocolSpi;

import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.remoting.RemotingException;
import com.alibaba.dubbo.rpc.Exporter;
import com.alibaba.dubbo.rpc.Invoker;
import com.alibaba.dubbo.rpc.RpcException;

/**
 * @author linhao
 * @date 2019/5/16
 * @Version V1.0
 */
public class XxxProtocol implements Protocol {

    @Override
    public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
        return new XxxExporter(invoker);
    }

    @Override
    public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
        try {
            return new XxxInvoker<T>(type,url);
        } catch (RemotingException e) {
            e.printStackTrace();
        }
        return null;
    }
}
